// shared.h: Header file for shared code.
// Written by Victor Luna Freire - victorclf@live.com
// Copyright (c) Victor Luna Freire. All rights reserved.
// Monday, October 26, 2009 12:30:19 AM

#ifndef SHARED_H_918230182830912
#define SHARED_H_918230182830912

#include <cstdlib> // rand()
#include <ctime> // time() for srand()


// A vector holding two integers.
struct Vec2i {
	int x,
		y;

	Vec2i(int xx=0, int yy=0) : x(xx), y(yy) { };

	friend bool operator==(const Vec2i& lhs, const Vec2i& rhs);
	friend bool operator!=(const Vec2i& lhs, const Vec2i& rhs);
};


// Cell status for graph algorithms
enum {
	UNTOUCHED, // WHITE
	FRONTIER,  // GRAY
	ADDED,     // BLACK
	IGNORED,   // WALL (used in solvers)
	EXIT,      // EXIT (used in solvers)
};


// Simple random function. Interval: [min, max)
int random(int max);
int random(int min, int max);

#endif // SHARED_H_918230182830912